package tugas.akhir.jason;

import android.content.ContentValues;
import android.content.Context;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase;

public class MyDBHelper extends SQLiteOpenHelper{
	 
	    final protected static String DATABASE_NAME="cameramiddasdb.db3";
	 
	    public MyDBHelper(Context context) {
	        super(context, DATABASE_NAME, null, 4);
	    }
	 
	    @Override
	    public void onCreate(SQLiteDatabase db) {
	        //db.execSQL("DROP TABLE storedImages;");
	        db.execSQL("CREATE TABLE storedImages (_id INTEGER PRIMARY KEY AUTOINCREMENT, image BLOB, tag TEXT);");
	    }

	    @Override
	    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
	        if (oldVersion >= newVersion)
	            return;
	 
	        onCreate(db);
	    }
/**	    
		public void insert(String idglobal, Intent alamatglobal) {
			ContentValues cv=new ContentValues();
			cv.put("idglobal", idglobal);
			cv.put("alamatglobal", alamatglobal);
			getWritableDatabase().insert("almag", "idglobal", cv);
		}
*/		
		

public void insert(String storedImages, String tag, ContentValues values) {
	// TODO Auto-generated method stub
	//ContentValues cv=new ContentValues();

	getWritableDatabase().insert("storedImages", tag, values);
}
	}